package luj.tool.jnproxyan.proxy.network.https.client;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelInboundHandlerAdapter;
import io.netty.handler.codec.http.HttpObject;

import java.util.function.Consumer;

final class InputListenHandler extends ChannelInboundHandlerAdapter {

  InputListenHandler(Consumer<HttpObject> inListener) {
    _inListener = inListener;
  }

  @Override
  public void channelRead(ChannelHandlerContext ctx, Object msg) {
    _inListener.accept((HttpObject) msg);
  }

  private final Consumer<HttpObject> _inListener;
}
